Imports System.IO
Public Class ToolStripProgressDemo

    Private Sub ToolStripProgressDemo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.ListView1.Columns.Add("Name", 200, HorizontalAlignment.Left)
        Me.ListView1.Columns.Add("Files", 50, HorizontalAlignment.Right)
        ListView1.View = View.Details
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim i As Integer = 0

        ListView1.Items.Clear()

        Dim dir As New DirectoryInfo("C:\WINDOWS")

        Dim item1 As ListViewItem

        ToolStripProgressBar1.Maximum = dir.GetFiles("*.*").Length()

        Dim f As FileInfo
        For Each f In dir.GetFiles("*.*")
            item1 = New ListViewItem(f.Name)
                item1.SubItems.Add(f.Length.ToString())             
            ListView1.Items.Add(item1)
            ToolStripProgressBar1.Value = i
            i = i + 1
        Next
        ToolStripStatusLabel1.Text = i.ToString & " file(s)"

    End Sub
End Class